import Vue from "vue";
import Vuex from "vuex";
import http from "../utils/http.js";

import product from "./product.js";
import category from "./category.js";
import home from "./home.js";
import menus from "./menus.js";
import detail from "./detail.js";
import site from "./site.js";
import cart from "./cart.js";
import order from "./order.js";
import orderDetail from "./orderDetail.js";
import profile from "./profile.js";
import userSet from "./userSet.js";
Vue.use(Vuex);
//创建并导出vuex
export default new Vuex.Store({
    state:{//存放保存在仓库中的数据
        $http:http
    },
    modules:{//开辟子仓库
        category,
        product,
        home,
        menus,
        detail,
        site,
        cart,
        order,
        orderDetail,
        profile,
        userSet
    }
});